package io.gitee.tziye.core.kv;

import io.gitee.tziye.RenaiClient;
import io.vavr.Tuple2;

import java.util.List;

public abstract class PriorityQOperator extends KvOperator {

    public PriorityQOperator(RenaiClient renaiClient) {
        super(renaiClient);
    }

    public abstract <T> List<Tuple2<T, Long>> members(String key, Class<T> clazz);

    public abstract <T> void add(String key, T value, long score);

    public abstract <T> void add(String key, List<Tuple2<T, Long>> list);

    public abstract <T> void addIfAbsent(String key, T value, long score);

    public abstract <T> void addIfAbsent(String key, List<Tuple2<T, Long>> list);

    public abstract <T> void addCover(String key, T value, long score);

    public abstract <T> void addCover(String key, List<Tuple2<T, Long>> list);

    public abstract <T> List<Tuple2<T, Long>> get(String key, int start, int count, Class<T> clazz);

    public abstract <T> List<Tuple2<T, Long>> revGet(String key, int start, int count, Class<T> clazz);

    public abstract <T> List<Tuple2<T, Long>> getByScore(String key, long start, long end, Class<T> clazz);

    public abstract <T> List<Tuple2<T, Long>> pop(String key, int start, int count, Class<T> clazz);

    public abstract <T> List<Tuple2<T, Long>> revPop(String key, int start, int count, Class<T> clazz);

    public abstract <T> List<Tuple2<T, Long>> popByScore(String key, long start, long end, Class<T> clazz);

    public abstract int delete(String key, int start, int count);

    public abstract int revDelete(String key, int start, int count);

    public abstract int deleteByScore(String key, long start, long end);

    public abstract <T> List<Long> score(String key, T value);

    public abstract <T> Long minScore(String key, T value);

    public abstract <T> Long maxScore(String key, T value);

    public abstract <T> List<Integer> rank(String key, T value);

    public abstract <T> Integer highestRank(String key, T value);

    public abstract <T> Integer lowestRank(String key, T value);

    public abstract <T> List<Integer> revRank(String key, T value);

    public abstract <T> Integer revHighestRank(String key, T value);

    public abstract <T> Integer revLowestRank(String key, T value);

    public abstract <T> List<Long> incr(String key, T value, long score);

}
